import request from '@/router/axios';

// 列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/interestedPartyMange/relatedparty/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 详情
export const getDetail = (id) => {
  return request({
    url: '/api/interestedPartyMange/relatedparty/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/interestedPartyMange/relatedparty/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

// 新增
export const add = (row) => {
  return request({
    url: '/api/interestedPartyMange/relatedparty/save',
    method: 'post',
    data: row
  })
}

// 修改
export const update = (row) => {
  return request({
    url: '/api/interestedPartyMange/relatedparty/update',
    method: 'post',
    data: row
  })
}

// 黑名单管理
export const blacklist = (ids, flag) => {
  return request({
    url: '/api/interestedPartyMange/relatedparty/blacklist',
    method: 'post',
    params: {
      ids,
      flag
    }
  })
}

// 获取人员列表
export const getUserList = () => { 
  return request({
    url: '/api/riskPoint/riskmanagement/getInternalStaff',
    method: 'get'
  })
}

// 查看已设置的审批人员
export const getApproveUserList = (bizId) => {
  return request({
    url: '/api/blade-flow/flow/flowtaskuser/list',
    method: 'get',
    params: {
      bizId
    }
  })
}

// 新增、修改审批人员
export const setApproveUser = (row) => {
  return request({
    url: '/api/interestedPartyMange/relatedparty/addApprovalPerson',
    method: 'post',
    data: row
  })
}

// 审批
export const approveRelatedParty = (bizId, isPass, remark) => {
  return request({
    url: '/api/interestedPartyMange/relatedparty/approval',
    method: 'post',
    data: {
      bizId,
      isPass,
      remark
    }
  })
}